package geo.users;

import com.motos.*;
import java.util.Scanner;

public class TestRent {
    public static void main(String[] args) {
        Customer cus=new Customer();

        Moto motos[]=new Moto[5];
        motos[0]=new Car("冀A001","宝马","white");
        motos[1]=new Car("冀A002","别克","red");
        motos[2]=new Car("冀A003","别克","blue");
        motos[3]=new Bus("冀A1001","red",16);
        motos[4]=new Bus("冀A1002","yellow",10);
        motos[5]=new Bus("冀A1003","yellow",10);
        motos[6]=new Truck("冀A2001","yellow",10);
        motos[7]=new Truck("冀A2002","yellow",20);
        motos[8]=new Truck("冀A2003","yellow",50);

//        System.out.println("序号\t车辆类型");
        System.out.println("请输入身份证：");
        Scanner s=new Scanner(System.in);
        int id=s.nextInt();
        System.out.println("请输入姓名:");
        String name=s.next();
        for (int i = 0; i < motos.length; i++) {
            if (motos[i] instanceof Car) {
                System.out.print(i+"\t"+"轿车"+"\t");
            }
            else if (motos[i] instanceof Bus) {
                System.out.print(i+"\t"+"客车"+"\t");
            }
            else if (motos[i] instanceof Truck) {
                System.out.print(i+"\t"+"货车"+"\t");
            }
            System.out.println(motos[i]);
        }

        System.out.println("请输入租聘车辆号：");
        int n=s.nextInt();
        System.out.println("请输入租聘天数");
        int days=s.nextInt();
        System.out.println("您的租聘信息为");
        if (motos[n] instanceof Car) {
            System.out.println(n+"\t"+"轿车"+"\t");
        }
        else if (motos[n] instanceof Bus) {
            System.out.println(n+"\t"+"客车"+"\t");
        }
        else if (motos[n] instanceof Truck) {
            System.out.println(n+"\t"+"货车"+"\t");
        }
        System.out.println(motos[n]);
        if (motos[n] instanceof Bluetooth) {
            Bluetooth bt=(Bluetooth) motos[n];
            bt.blueTooth();
        }
        if(motos[n] instanceof Navigate){
            Navigate ng=(Navigate)motos[n];
            ng.navigate();
        }
        System.out.println("总租金"+cus.calcTotalRent(motos[n],days) );


    }

}
